<template>
    <div>
        <el-button @click="showG">comG</el-button>

        <ul>
            <li v-for="(item,index) in comGData" :key="index">姓名：{{item.name}} - 年龄：{{item.age}}</li>
        </ul>

    </div>
</template>
<script>
export default {
   props:['comGData'],
    
    data() {
        return {
            testData:"111"
        }
    },
    methods:{
        showG() {
            this.$emit('emitShowG',12)
        }
    },
     beforeCreate(){
        console.log("子组件beforeCreate",'this.testData=',this.testData,'this.$parent.say=',this.$parent.say);
    },
    created() {
        console.log("子组件created",'this.testData=',this.testData,'this.$parent.say=',this.$parent.say);
    },
    beforeMount(){
        console.log("子组件beforeMount",'this.testData=',this.testData,'this.$parent.say=',this.$parent.say);
    },
    mounted(){
        console.log("子组件mounted",'this.testData=',this.testData,'this.$parent.say=',this.$parent.say);
    }
}
</script>